<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis;


class IndexController extends Controller
{
    public function index()
    {
        return view('home.index');
    }

    public function getsalt(Request $request)
    {
        $username = $request->get('username');
        $salt = mt_rand(10000,99999);

        Redis::set('salt_'.$username,$salt);

        return array('code'=>0,'salt'=>$salt);
    }
}
